{include file='./inc/header.tpl'}
<div id="wrap">
    {include file='./inc/head.tpl'}
    <div id="contents">
        <div class="ttl">
            <h2>フィールド登録</h2>
        </div>

        <form action="./" method="post" name="search_form">
            <input type="hidden" name="mode" value="search" />
            <input type="hidden" name="transid" value="{$transactionid}">
            <!--{foreach from=$arrHidden key="key" item="item"}-->
                <!--{if is_array($item)}-->
                    <!--{foreach item=c_item from=$item}-->
                        <input type="hidden" name="{$key}[]" value="{$c_item}" />
                    <!--{/foreach}-->
                <!--{else}-->
                    <input type="hidden" name="{$key}" value="{$item}" />
                 <!--{/if}-->
            <!--{/foreach}-->
        </form>

        <div class="formBox">
            <h3>情報入力</h3>
            {include file='./inc/message.tpl'}
            <form action="./admin/field_edit" method="post" id="form1" name="form1">
            <input type="hidden" name="transid" value="{$transactionid}">
            <input type="hidden" name="mode" value="" />
            {assign var=key value="field_id"}
            <input type="hidden" name="{$key}" value="{$arrForm[$key].value}" />
            <!--{foreach from=$arrHidden key="key" item="item"}-->
                <!--{if is_array($item)}-->
                    <!--{foreach item=c_item from=$item}-->
                        <input type="hidden" name="{$key}[]" value="{$c_item}" />
                    <!--{/foreach}-->
                <!--{else}-->
                    <input type="hidden" name="{$key}" value="{$item}" />
                 <!--{/if}-->
            <!--{/foreach}-->
                <dl>
                    <dt>フィールド名</dt>
                    {assign var=key value="field_name"}
                    <dd>
                        <input type="text" name="{$key}" size="40" value="{$arrForm[$key].value}" />
                        {if !empty($arrErr[$key].error)}<div class="attention">{$arrErr[$key].error}</div>{/if}
                    </dd>

                    <dt>カテゴリ</dt>
                    {assign var=key value="category_id"}
                    <dd>
                        {html_options name=$key options=$config.default_list+$category selected=$arrForm[$key].value}
                        {if !empty($arrErr[$key].error)}<div class="attention">{$arrErr[$key].error}</div>{/if}
                    </dd>
                </dl>
                <input class="primary" onclick="fnReturn();" type="button" value="検索画面に戻る"/>
                <input class="primary" onclick="submitForm('form1','complete');" type="button" value="この内容で登録する"/>
            </form>
        </div><!-- #fromBox -->
    </div><!-- #contents -->
</div><!-- #wrap -->
<<script type="text/javascript">
<!--
function fnReturn() {
    document.search_form.action = './admin/field';
    document.search_form.mode.value = "search";
    document.search_form.submit();
    return false;
}
//-->
</script>
{include file='./inc/footer.tpl'}